# uPL0

A small project that combines a simple softcore, an “old-fashioned” compiler, and some kind of primitive disassembler.

## uPL0 (micro-programming-language-0)
This language is a modified PL/0 and is designed for use for microcontrollers. The main changes are:

1. The ```odd```, ```!```, ```?``` operators has been removed.
2. Added bitwise operators NOT (```~```), OR (```|```), AND (```&```), XOR (```^```).
3. Added the ```MEM``` data type - a single level pointer.
4. Nested procedures are not allowed.

The full syntax of the language is in [docs/ebnf.txt](https://notabug.org/dh33ex/uPL0/src/master/docs/ebnf.txt)

## Compiler
Contains compiler code in the C language. The compiler is single pass, uses a recursive descending algorithm. There are no optimization mechanisms, even constant folding.

## Dissembler
Some kind of disassembler with the linear sweep method.

## Architecture
Based on the architecture proposed by Niklaus Wirth in his book Compiler Construction (2017).
There are two hardware implementations for OrangeCrab and Tang Nano 9k.

More details are available in [docs/risc.txt](https://notabug.org/dh33ex/uPL0/src/master/docs/risc.txt)

## Examples
Examples that demonstrate possibilities of language and use of the periphery of soft-core hardware.
